home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cc01.zip / BREAKXMP.C < prev    next >
Text File  |  1985-08-28  |  584b  |  35 lines

  1. /*
  2.  
  3.     try Lattice C control break interrupt handler
  4.  
  5. */
  6.  
  7. #include <h\stdio.h>
  8.  
  9. main(argc, argv)
  10.     int   argc;
  11.     char  *argv[];
  12.  
  13. {   int hit = 0;
  14.     int c = 0;
  15.     static int flag = 0;
  16.  
  17.     capture(&flag);
  18.     puts("\nTRY has CAPTURED interrupt vectors\n");
  19.  
  20.     while ( (c&127) != 'Q') 
  21.     {      hit = kbhit();
  22.            if (flag != 0)
  23.         { puts("\nControl-Break detected\n");
  24.               flag=0;
  25.                 }    
  26.     if (hit != 0)
  27.          {  c=getch();
  28.         putch(c);
  29.      }
  30.     } 
  31.    release();
  32.    puts("\n\nTRY has RELEASEd interrupt vectors\n");
  33.  
  34. }
  35.